package com.model.service;

import com.entity.Book;
import com.mapper.BookMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BookService {
    @Resource
    BookMapper bookMapper;

    public List<Book> listAll(){
        return bookMapper.listAll();
    }
    public Book listOne(Integer id){
        return bookMapper.listOne(id);
    }
    public void addOne(Book book)throws Exception{
        bookMapper.addOne(book);
    }
    public void dropOne(Integer id){
        bookMapper.dropOne(id);
    }
    public void setOne(Book book){
        bookMapper.setOne(book);
    }
}
